<?php
/**
 * Create By: PhpStorm
 * User: yihua
 * File: Flag.php
 * Date: 2016/12/11
 * Time: 15:50
 */
namespace app\library;

class Flag
{
    const SMS_EXPIRE_TIME = 60;
    const ADDRESS_STATUS_ACTIVE = 1; //用户有效地址
    const ADDRESS_STATUS_DELETED = 0; //用户删除地址
    const ADDRESS_MAX = 5; //用户最多设置地址
    const ADDRESS_DEFAULT = 1; //默认地址
    const ADDRESS_NOT_DEFAULT = 0; //非默认地址
    const USER_FAVORITE_ACTIVE = 1; //用户收藏
    const USER_FAVORITE_DELETED = 0; // 用户删除的收藏
    const USER_COUPON_VALID = 1; //用户有效优惠券
    const USER_COUPON_INVALID = 0; //无效优惠券
    const USER_COUPON_USED = 2; //使用过的优惠券
    const CURRENCY_TYPE_COIN = 1; //漫币
    const CURENCY_TYPE_INTEGRAL = 2; //漫豆
    //漫豆漫币消费类型
    const  CURRENCY_EXCHANGE_TYPE_DASHANG = 1;  //打赏
    const  CURRENCY_EXCHANGE_TYPE_BUY_GOODS = 2; //购物
    const  CURRENCY_EXCHANGE_TYPE_BUY_COIN = 3; //购买漫币
    const  CURRENCY_EXCHANGE_TYPE_BUY_INTERRAL = 4; //购买漫豆
    const  CURRENCY_EXCHANGE_TYPE_BUY_TASK = 5; //每日任务

    const USER_COUPON_STATUS_NOT_USED = 1; //优惠券领取未使用
    const USER_COUPON_STATUS_USED = 2; //优惠券已经使用
    const USER_COUPON_STATUS_EXPIRED = 3;//优惠券已经过期
    const COUPON_STATUS_VALID = 1; //优惠券开关：有效
    const COUPON_STATUS_INVALID = 0; //优惠券开关：无效

    // 登录类型
    const IDENTIFY_TYPE_PHONE = 1;
    const IDENTIFY_TYPE_WEIXIN = 2;
    const IDENTIFY_TYPE_WEIBO = 3;
    const IDENTIFY_TYPE_EMAIL = 4;

    // 社区相关
    const CONST_CIRCLE_DELETE_NOT = 0; // 标记圈子未被删除
    const CONST_CIRCLE_DELETED = 1; // 标记圈子被删除
    const CONST_CIRCLE_APPROVE = 0; // 圈子未审核
    const CONST_CIRCLE_APPROVE_PASS = 1; // 圈子审核通过
    const CONST_CIRCLE_APPROVE_REJECT = 2; // 圈子审核驳回
    const CONST_CIRCLECATEGORY_DELETE_NOT = 0; // 标记圈子分类未被删除
    const CONST_CIRCLECATEGORY_DELETED = 1; // 标记圈子分类被删除
    const CONST_NOTE_DELETE_NOT = 0; // 标记帖子未被删除
    const CONST_NOTE_DELETED = 1; // 标记帖子被删除
    const CONST_NOTEREPLY_DELETE_NOT = 0; // 标记帖子回复未被删除
    const CONST_NOTEREPLY_DELETED = 1; // 标记帖子回复被删除
    const CONST_CIRCLE_TAB_ALL = 1; // 全部
    const CONST_CIRCLE_TAB_FOLLOW = 2; // 我的关注
    const CONST_CIRCLE_TAB_HOT = 3; // 最热
    const CONST_CIRCLE_TAB_NEW = 4; // 最新
    const CONST_CIRCLE_TAB_MYCREATE = 5; // 我创建的
    const CONST_NOTEPRIASE_DELETE_NOT = 0; // 标记帖子赞未被删除
    const CONST_NOTEPRIASE_DELETED = 1; // 标记帖子赞被删除
    const CONST_DASHANGGIFT_DOWN = 0; // 标记打赏礼物下架
    const CONST_DASHANGGIFT_UP = 1; // 标记打赏礼物上架
    const CONST_NOTEREPLAY_DELETE_NOT = 0; // 标记帖子回复未被删除
    const CONST_NOTEREPLAY_DELETED = 1; // 标记帖子回复被删除
    const CONST_NOTE_ORIGINAL_NOT = 0; // 非原创帖子
    const CONST_NOTE_ORIGINAL = 1; // 原创帖子
    const CONST_NOTE_TAB_EXQUISITE = 1; // 精选
    const CONST_NOTE_TAB_NEW = 2; // 最新
    const CONST_NOTE_TAB_HOT = 3; // 最热
    const CONST_NOTE_TAB_ORIGINAL = 4; // 原创

    // 订单状态
    const ORDER_STATUS_NOT_PAY = 1; // 未付款
    const ORDER_STATUS_NOT_SENDING = 2; // 未发货
    const ORDER_STATUS_SENDING = 3; // 已发货
    const ORDER_STATUS_FINISH = 4; //已完成
    const ORDER_STATUS_CANCEL = 5; //订单取消
    const ORDER_STATUS_DELETE = 10;//订单删除
    const ORDER_STATUS_WKJ = 11; // 未开奖
    const ORDER_STATUS_YKJ = 12; // 已开奖
    const ORDER_STATUS_YZJ = 13; // 已中奖

    const ORDER_TYPE_SHANGCHENG = 0;
    const ORDER_TYPE_YIYUANDUOBAO = 1;

    //优惠券类型
    static $coupon_type = [
        '1' => '全场通用',
        '2' => '特定品类',
        '3' => '其它',
    ];

    // 订单状态map
    static $map_order = [
        self::ORDER_STATUS_NOT_PAY => '未付款',
        self::ORDER_STATUS_NOT_SENDING => '未发货',
        self::ORDER_STATUS_SENDING => '已发货',
        self::ORDER_STATUS_FINISH => '已完成',
        self::ORDER_STATUS_CANCEL => '订单取消',
        self::ORDER_STATUS_DELETE => '订单删除',
    ];

    // 商品配送状态
    const SHIPPING_STATUS_NOT_SENDING = 0; // 未发货
    const SHIPPING_STATUS_SENDING = 1;     // 已发货
    const SHIPPING_STATUS_RECEIVED = 2;    // 已收货
    const SHIPPING_STATUS_READY = 3;       // 备货中

    // 商品配送状态map
    static $map_shipping = [
        self::SHIPPING_STATUS_NOT_SENDING => '未发货',
        self::SHIPPING_STATUS_SENDING => '已发货',
        self::SHIPPING_STATUS_RECEIVED => '已收货',
        self::SHIPPING_STATUS_READY => '备货中',
    ];

    // 支付状态
    const PAY_STATUS_NOT = 0;  // 未付款
    const PAY_STATUS_ON = 1;  // 付款中
    const PAY_STATUS_ALREADY = 2;  // 已付款
    const PAY_STATUS_RETURN = 3; // 已退款

    // 支付状态map
    static $map_pay = [
        self::PAY_STATUS_NOT => '未付款',
        self::PAY_STATUS_ON => '付款中',
        self::PAY_STATUS_ALREADY => '已付款',
        self::PAY_STATUS_RETURN => '已退款',
    ];

    // 夺宝状态
    const DUOBAO_STATUS_FINISH = 0;  // 结束
    const DUOBAO_STATUS_ON = 1;  // 进行中
    const DUOBAO_STATUS_OPEN = 2;  // 开奖中

    // 夺宝状态map
    static $map_duobao = [
        self::DUOBAO_STATUS_FINISH => '已结束',
        self::DUOBAO_STATUS_ON => '进行中',
        self::DUOBAO_STATUS_OPEN => '开奖中',
    ];

    // 关注类型
    const CONST_FOLLOW_GOODS = 1;  // 商品
    const CONST_FOLLOW_CIRCLE = 2;  // 圈子
    const CONST_FOLLOW_NOTE = 3;  // 帖子
    const CONST_FOLLOW_PEOPLE = 4;  // 人

    // 图片上传关联对象的类型
    const CONST_PICTURE_GOODS = 1;  // 商品
    const CONST_PICTURE_CIRCLE = 2;  // 圈子
    const CONST_PICTURE_NOTE = 3;  // 帖子
    const CONST_PICTURE_PEOPLE = 4;  // 人

    // 新手任务
    const CONST_TASK_NEW_NOTE_COUNT = 3; // 3条帖子
    const CONST_TASK_NEW_NOTE_REPLY_COUNT = 3; // 3条帖子回复

    // 日常任务
    const CONST_TASK_DAILY_NOTE_COUNT = 1; // 1条帖子
    const CONST_TASK_DAILY_NOTE_REPLY_COUNT = 1; // 1条帖子回复

    // 商品活动类型
    const GOODS_ACTIVITY_LIMIT = 1; // 限时购

    // banner类型
    const CONST_BANNER_TYPE_MALL = 1;          // 商城banner
    const CONST_BANNER_TYPE_COMMUNITY = 2;     // 社区banner
    const CONST_BANNER_TYPE_COMMUNITY_AD = 3;  // 社区广告

    // banner状态
    const CONST_BANNER_STATUS_ONGOING = 0;
    const CONST_BANNER_STATUS_ON = 1;
    const CONST_BANNER_STATUS_OFF = 2;
    const CONST_BANNER_STATUS_DEL = 3;

    // 帖子审核状态
    const CONST_NOTE_APPROVE = 0; // 帖子未审核
    const CONST_NOTE_APPROVE_PASS = 1; // 帖子审核通过
    const CONST_NOTE_APPROVE_REJECT = 2; // 帖子审核驳回

    // 文件上传的尺寸和大小
    const IMGMAXWIDTH = 12288;
    const IMGMAXHIGHT = 4096;
    const ATTACHMENTSIZE = 10485760;


    static $arr_identify_type = array(
        1 => 1,
        2 => 2,
        3 => 3,
        4 => 4,
    );

    // 圈子分类
    static $arr_circle_tab = [
        self::CONST_CIRCLE_TAB_ALL,
        self::CONST_CIRCLE_TAB_FOLLOW,
        self::CONST_CIRCLE_TAB_HOT,
        self::CONST_CIRCLE_TAB_NEW,
    ];

    // 用户评论星级
    static $arr_comment_rank = [
        'good' => [5],
        'nomal' => [3, 4],
        'bad' => [1, 2],
    ];

    // 图片类型map
    static $map_pic = [
        self::CONST_PICTURE_GOODS => 'goods',
        self::CONST_PICTURE_CIRCLE => 'circle',
        self::CONST_PICTURE_NOTE => 'note',
        self::CONST_PICTURE_PEOPLE => 'people',
    ];

    // 打卡任务 - 新手任务
    static $task_new = [
        1 => [
            'id' => '1',
            'name' => '完善个人资料',
            'money' => '15',
            'rate' => '0%',
            'is_complete' => '0',
        ],
        2 => [
            'id' => '2',
            'name' => '发表帖子',
            'money' => '10',
            'rate' => '0/3',
            'is_complete' => '0',
        ],
        3 => [
            'id' => 3,
            'name' => '回复帖子',
            'money' => '5',
            'rate' => '0/3',
            'is_complete' => '0',
        ],
    ];

    // 打卡任务 - 日常任务
    static $task_daily = [
        100 => [
            'id' => '100',
            'name' => '发表帖子',
            'money' => '6',
            'rate' => '0/3',
            'is_complete' => '0',
        ],
        101 => [
            'id' => '101',
            'name' => '回复帖子',
            'money' => '3',
            'rate' => '0/3',
            'is_complete' => '0',
        ],
    ];

    // 榜单tab分类
    const CONST_RANK_TAB_TODAY = 1;  // 今日
    const CONST_RANK_TAB_WEEK = 2;  // 本周
    const CONST_RANK_TAB_MONTH = 3;  // 累计

    //banner类型定义
    static $banner_type = [
        '1' => '商城',
        '2' => '社区',
        '3' => '社区广告',
    ];

    // 用户标签色值
    static $label_color = [
        '#272727',
        '#d0d0d0',
        '#4DFFFF',
        '#28FF28',
        '#FF5809',
        '#F9F900',
        '#FF0000',
        '#6F00D2',
    ];

    // 词库类型
    const CONST_WORD_TYPE_NOTE = 1; // 帖子的关键字
    const CONST_WORD_TYPE_CIRCLE = 2; // 圈子的关键字

    // note flag
    const FLAG_NOTE_EXQUISITE = 1;//精选
    const FLAG_NOTE_HOT = 2;//最热
    const FLAG_NOTE_ORIGIN = 4;//原创
    static $note_type_map = [
        self::FLAG_NOTE_EXQUISITE => '精选',
        self::FLAG_NOTE_HOT => '最热',
        self::FLAG_NOTE_ORIGIN => '原创',
    ];

    // circle flag
    const FLAG_CIRCLE_HOT = 1;
    const FLAG_CIRCLE_RECOMMEND = 2;

    // 贡献值conf
    static $contribution_map = [
        'note' => 10,
        'note_reward' => 9,
        'note_reply' => 6,
        'note_praise' => 3,
        'note_view' => 1,
    ];

    static $currency_exchange_map = [
        self::CURRENCY_EXCHANGE_TYPE_DASHANG => '打赏',
        self::CURRENCY_EXCHANGE_TYPE_BUY_GOODS => '购物',
        self::CURRENCY_EXCHANGE_TYPE_BUY_COIN => '购买漫币',
        self::CURRENCY_EXCHANGE_TYPE_BUY_INTERRAL => '购买漫豆',
        self::CURRENCY_EXCHANGE_TYPE_BUY_TASK => '每日任务'
    ];

    static $integral_rule = [
        'signin' => [
            'once' => 1,
            'num' => 1,
        ],
        'share' => [
            'once' => 1,
            'num' => 3,
        ],
        'note' => [
            'once' => 2,
            'num' => 3,
        ],
        'praise' => [
            'once' => 1,
            'num' => 5,
        ],
        'exquisite' => [
            'once' => 1,
            'num' => 1000000,
        ],
        'task_account' => [
            'once' => 15,
            'num' => 1,
        ],
        'task_note' => [
            'once' => 10,
            'num' => 1,
        ],
        'task_reply_note' => [
            'once' => 5,
            'num' => 1,
        ],
        'task_daily_note' => [
            'once' => 6,
            'num' => 1,
        ],
        'task_daily_reply_note' => [
            'once' => 3,
            'num' => 1,
        ],
    ];


    // 圈子默认图片
    const CONST_CIRCLE_DEFAULT_ICON = 'http://manshe-app.oss-cn-beijing.aliyuncs.com/note/20170325/08635e5c158c165a358a9bc2b70d3852.jpg';
}